home *** CD-ROM | disk | FTP | other *** search
- on hCCInitialSetup ccChannel
- global gintClosedCaptionStatus, gCCtext, gCCtextChannel, gCCtextnum
- set gCCtextnum to the number of member "ccTextBox"
- set gintClosedCaptionStatus to -1
- set gCCtext to "cctext 3 empty lines"
- set gCCtextChannel to ccChannel
- set the text of member gCCtextnum to " "
- set the loc of sprite gCCtextChannel to point(320, 428)
- puppetSprite(gCCtextChannel, 1)
- hCCScrollBoxInit()
- set the memberNum of sprite gCCtextChannel to member "cc avail buttonU"
- set the ink of sprite gCCtextChannel to 8
- set the visible of sprite gCCtextChannel to 1
- updateStage()
- end
-
- on hPlayNarrationFile intSoundChannel, textFileName
- global gCCtext, gintClosedCaptionStatus
- if gintClosedCaptionStatus < 0 then
- set gintClosedCaptionStatus to -1 * gintClosedCaptionStatus
- if the platform contains "Windows" then
- sound playFile intSoundChannel, the pathName & "audio\" & textFileName
- else
- sound playFile intSoundChannel, the pathName & "audio:" & textFileName
- end if
- set gCCtext to textFileName
- if gintClosedCaptionStatus > 1 then
- hCCSetupText()
- startTimer()
- end if
- end if
- end
-
- on hCCSetupText
- global gintClosedCaptionStatus, gCCtextnum, gCCtext, gCCtextChannel, gintCCTextLines
- put the text of member gCCtext into field gCCtextnum
- set the scrollTop of member gCCtextnum to 0
- if (the name of member the memberNum of sprite gCCtextChannel <> "ccTextBox") and (abs(gintClosedCaptionStatus) > 1) then
- set the castNum of sprite gCCtextChannel to member "ccTextBox"
- set the ink of sprite gCCtextChannel to 0
- end if
- updateStage()
- set gintCCTextLines to the lineCount of member gCCtextnum
- end
-
- on hCCNarrationCompletionCheck intSoundChannel, intAnotherNarrFlag, intJumpLocation
- global gintClosedCaptionStatus, gCCtextnum, gintCCTextLines
- if gintClosedCaptionStatus > 1 then
- if gintCCTextLines <= 3 then
- if the timer >= (gintCCTextLines * gintClosedCaptionStatus * 60) then
- set gintClosedCaptionStatus to -1 * gintClosedCaptionStatus
- end if
- else
- if the timer >= (3 * gintClosedCaptionStatus * 60) then
- set gintCCTextLines to gintCCTextLines - 3
- scrollByLine(member gCCtextnum, 3)
- startTimer()
- end if
- end if
- end if
- if (soundBusy(intSoundChannel) = 1) or (gintClosedCaptionStatus > 1) then
- if gintClosedCaptionStatus < 0 then
- set gintClosedCaptionStatus to gintClosedCaptionStatus * -1
- end if
- if the frame < (intJumpLocation - 1) then
- go(the frame + 1)
- else
- go(the frame)
- end if
- else
- if gintClosedCaptionStatus > 0 then
- set gintClosedCaptionStatus to -1 * gintClosedCaptionStatus
- end if
- if intAnotherNarrFlag = 0 then
- hCCEndNarration()
- updateStage()
- end if
- set the text of member gCCtextnum to " "
- if intJumpLocation = 0 then
- go(the frame)
- else
- go(the frame + 1)
- end if
- end if
- end
-
- on hCCSetScrollRate mouseY
- global gintClosedCaptionStatus, gCCtextnum, gCCtextChannel
- set intMenuSelection to (mouseY - the top of sprite gCCtextChannel) / 14
- set stringCurrentButton to the name of member the castNum of sprite gCCtextChannel
- case intMenuSelection of
- 2:
- set tempClosedCaptionStatus to -1
- set the castNum of sprite gCCtextChannel to the number of member stringCurrentButton + 1
- 3:
- set tempClosedCaptionStatus to -4
- set the castNum of sprite gCCtextChannel to the number of member stringCurrentButton + 2
- 4:
- set tempClosedCaptionStatus to -3
- set the castNum of sprite gCCtextChannel to the number of member stringCurrentButton + 3
- 5:
- set tempClosedCaptionStatus to -2
- set the castNum of sprite gCCtextChannel to the number of member stringCurrentButton + 4
- otherwise:
- set tempClosedCaptionStatus to -1 * abs(gintClosedCaptionStatus)
- end case
- updateStage()
- set waitTicks to 30
- set currTicks to the timer
- repeat while the timer < (currTicks + waitTicks)
- nothing()
- end repeat
- if tempClosedCaptionStatus = -1 then
- set the castNum of sprite gCCtextChannel to member "cc avail buttonU"
- set the ink of sprite gCCtextChannel to 8
- set the text of member gCCtextnum to " "
- if gintClosedCaptionStatus > 0 then
- set gintClosedCaptionStatus to tempClosedCaptionStatus * -1
- else
- set gintClosedCaptionStatus to tempClosedCaptionStatus
- end if
- else
- if gintClosedCaptionStatus > 0 then
- set the castNum of sprite gCCtextChannel to member "ccTextBox"
- hCCSetupText()
- startTimer()
- set gintClosedCaptionStatus to tempClosedCaptionStatus * -1
- else
- set the castNum of sprite gCCtextChannel to member "cc on buttonU"
- set the ink of sprite gCCtextChannel to 8
- set gintClosedCaptionStatus to tempClosedCaptionStatus
- end if
- end if
- updateStage()
- end
-
- on hCCIconClicked mouseY
- global gCCtext, gintClosedCaptionStatus, gCCtextChannel
- set thisSprite to the clickOn
- set thisSpriteCast to the name of member the castNum of sprite thisSprite
- delete char the number of chars in thisSpriteCast of thisSpriteCast
- case thisSpriteCast of
- "cc avail button", "cc on button":
- set the ink of sprite gCCtextChannel to 8
- set the castNum of sprite gCCtextChannel to member (thisSpriteCast & "menu" & "U")
- "cc avail buttonmenu", "cc on buttonmenu":
- hCCSetScrollRate(mouseY)
- "ccTextBox":
- set the castNum of sprite gCCtextChannel to member "cc on buttonmenuU"
- set the ink of sprite gCCtextChannel to 8
- otherwise:
- nothing()
- end case
- updateStage()
- call(#init, the scriptInstanceList of sprite thisSprite)
- end
-
- on hCCScrollBoxInit
- global gCCtext, gCCtextnum, gCCtextChannel
- put the text of member "cctext 3 empty lines" into field gCCtextnum
- if the machineType = 256 then
- set the textFont of member gCCtextnum to "Arial"
- set the textSize of member gCCtextnum to 12
- set the backcolor of member gCCtextnum to 252
- else
- set the textFont of member gCCtextnum to "Helvetica"
- set the textSize of member gCCtextnum to 14
- set the backcolor of member gCCtextnum to 253
- end if
- set the textStyle of member gCCtextnum to "plain"
- set the foreColor of member gCCtextnum to 0
- set the boxType of member gCCtextnum to #fixed
- put the text of member gCCtext into field gCCtextnum
- end
-
- on hCCCleanUp
- global gCCtextChannel, gCCtextnum
- puppetSprite(gCCtextChannel, 0)
- set the text of member gCCtextnum to " "
- end
-
- on hCCEndNarration
- global gintClosedCaptionStatus, gCCtextChannel, gCCtextnum
- set stringCurrentButton to the name of member the castNum of sprite gCCtextChannel
- set the text of member gCCtextnum to " "
- case stringCurrentButton of
- "ccTextBox":
- set the castNum of sprite gCCtextChannel to member "cc on buttonU"
- set the ink of sprite gCCtextChannel to 8
- otherwise:
- nothing()
- end case
- end
-